<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>系统管理</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        .btn {
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
        }
    </style>
</head>
<body>
<h1>系统管理</h1>
<button id="snapshot-btn" class="btn">触发规则快照</button>

<script>
    $(document).ready(function() {
        $("#snapshot-btn").click(function() {
            $.ajax({
                url: "/api/trigger_snapshot",
                type: "POST",
                success: function(response) {
                    alert("快照成功");
                },
                error: function(xhr, status, error) {
                    console.error("Failed to trigger snapshot:", error);
                    alert("触发快照失败，请稍后重试");
                }
            });
        });
    });
</script>
</body>
</html>
